package com.bw.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bw.dao.UserRoleMapper;
import com.bw.entity.UserRole;
import com.bw.service.UserRoleService;

@Service(value = "userRoleService")
public class UserRoleServiceImpl implements UserRoleService {

    @Autowired
    private UserRoleMapper<UserRole>userRoleMapper;
    
    @Override
    public Integer insertSelective(UserRole userRole) throws Exception {
           return this.userRoleMapper.insertSelective(userRole);
        }

    @Override
    public Integer insertBatch(List<UserRole> userRole) throws Exception {
           return this.userRoleMapper.insertBatch(userRole) ;
        }

    @Override
    public Integer deleteByPrimaryKey(Object id) {
            return this.userRoleMapper.deleteByPrimaryKey(id);
    }

    public Integer deleteBatchByPrimaryKey(List<Object> ids) {
           return this.userRoleMapper.deleteBatchByPrimaryKey(ids);
    }

    @Override
    public Integer updateByPrimaryKeySelective(UserRole userRole) {
           return this.userRoleMapper.updateByPrimaryKeySelective(userRole);
    }

    @Override
    public UserRole findById(Object id) {
           return (UserRole) this.userRoleMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<UserRole> selectByCondition(UserRole userRole) {
           return (List<UserRole>) this.userRoleMapper.selectByCondition(userRole);
    }

    @Override
    public Integer selectCountByCondition(UserRole userRole) {
           return  this.userRoleMapper.selectCountByCondition(userRole);
    }

}
